package com.j283_5.wisdom_park.controller.investment_management.contract;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.j283_5.wisdom_park.common.result.ResultData;
import com.j283_5.wisdom_park.pojo.CollectionRecord;
import com.j283_5.wisdom_park.pojo.ContractTable;
import com.j283_5.wisdom_park.pojo.Visitors;
import com.j283_5.wisdom_park.service.ContractTableService;
import com.j283_5.wisdom_park.vo.contract_management.CollectionRecordVo;
import com.j283_5.wisdom_park.vo.contract_management.ContractTableVo;
import com.j283_5.wisdom_park.vo.contract_management.RoomVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.websocket.server.PathParam;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;

/**
 * <p>
 * 合同表 前端控制器
 * </p>
 *
 * @author 冯弋舟
 * @since 2022-04-28
 */
@RestController
@RequestMapping("/contract-table")
@Api(value = "招商合同管理",tags = "招商合同管理",produces="冯弋舟")
public class ContractTableController {

    @Resource
    private ContractTableService service;
    /**
     * 多条件查询合同
     * @return
     */
    @RequestMapping(value = "/findContractTable" , method = RequestMethod.GET)
    @ApiOperation(value = "查询所有合同信息",notes = "查询所有合同信息（分页）",produces="冯弋舟", response = ResultData.class)
    public ResultData findContractTable(@Param("page") Integer page, @Param("limit")Integer limit,ContractTableVo contractTableVo){
        List<ContractTableVo> list=new ArrayList<>();
        ContractTableVo contractTableVo1=new ContractTableVo(1,"罗遗言文化有限公司","C2栋",206,"新签",0,new Timestamp(System.currentTimeMillis()),new Timestamp(System.currentTimeMillis()));
        list.add(contractTableVo1);
        return ResultData.ok().data(list);
    }

    /**
     * 查询租凭房间信息
     * @param contractTableVo
     * @return
     */
    @RequestMapping(value = "/findRoom",method = RequestMethod.GET)
    @ApiOperation(value = "查询租凭房间信息",notes = "查询租凭房间信息",produces="冯弋舟", response = ResultData.class)
    public ResultData findRoom(ContractTableVo contractTableVo){
        List<RoomVo> list=new ArrayList<>();
        RoomVo roomVo=new RoomVo(1,308,55.23,55.0,206.0,"A1栋");
        list.add(roomVo);
        return ResultData.ok().data(list);
    }

    /**
     * 查询收款信息
     * @param contractTableVo
     * @return
     */
    @RequestMapping(value = "/findCollection_record",method = RequestMethod.GET)
    @ApiOperation(value = "查询收款信息",notes = "查询收款信息",produces="冯弋舟", response = ResultData.class)
    public ResultData findCollection_record(ContractTableVo contractTableVo){
        List<CollectionRecordVo> list=new ArrayList<>();
        CollectionRecordVo recordVo=new CollectionRecordVo(1,"滨康大道时代分户","622847129052349412","src/main/resources/img","杭州银行");
        list.add(recordVo);
        return ResultData.ok().data(list);
    }

    /**
     * 删除合同
     * @param listPerId
     * @return
     */
    @RequestMapping(value = "/delete_ContractTable",method = RequestMethod.POST)
    @ApiOperation(value = "删除合同",notes = "删除合同）",produces="冯弋舟", response = ResultData.class)
    public ResultData delete_ContractTable(@PathParam("listPerId") ArrayList<Integer> listPerId){
        return ResultData.ok();
    }

    /**
     * 新增合同
     * @param contractTable
     * @return
     */
    @RequestMapping(value = "/insert_ContractTable",method = RequestMethod.POST)
    @ApiOperation(value = "新增合同",notes = "新增合同",produces="冯弋舟", response = ResultData.class)
    public ResultData insert_ContractTable(ContractTable contractTable,RoomVo roomVo,CollectionRecord record){
        return ResultData.ok();
    }


}

